-- GENERATED SPELL FOR [Crazed Mana-Surge] --


function spell0_26737(pUnit, Event) --@Arcane Nova,Self--
pUnit:FullCastSpellOnTarget(47696,pUnit)
pUnit:RegisterEvent('Sorts_26737', 1500, 1)
end

function spell1_26737(pUnit, Event) --@Arcane Nova,Self--
pUnit:FullCastSpellOnTarget(57046,pUnit)
pUnit:RegisterEvent('Sorts_26737', 1500, 1)
end

function spell2_26737(pUnit, Event) --@Loose Mana,n/a--
pUnit:FullCastSpellOnTarget(29882,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_26737', 20000, 1)
end

function spell3_26737(pUnit, Event) --@Mana Burn,n/a--
pUnit:FullCastSpellOnTarget(48054,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_26737', 2000, 1)
end

function spell4_26737(pUnit, Event) --@Mana Burn,n/a--
pUnit:FullCastSpellOnTarget(57047,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_26737', 2000, 1)
end

function Sorts_26737(pUnit, Event)
local choix_sorts_26737 = math.random(0, 4)
if choix_sorts_26737 == 0 then
pUnit:RegisterEvent('spell0_26737', 1, 1)
end
if choix_sorts_26737 == 1 then
pUnit:RegisterEvent('spell1_26737', 1, 1)
end
if choix_sorts_26737 == 2 then
pUnit:RegisterEvent('spell2_26737', 1, 1)
end
if choix_sorts_26737 == 3 then
pUnit:RegisterEvent('spell3_26737', 1, 1)
end
if choix_sorts_26737 == 4 then
pUnit:RegisterEvent('spell4_26737', 1, 1)
end
end

function mob26737_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_26737', math.random(1500, 3000), 1)
end

function mob26737_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob26737_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob26737_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(26737, 1, 'mob26737_Action')
RegisterUnitEvent(26737, 2, 'mob26737_Leave')
RegisterUnitEvent(26737, 3, 'mob26737_Kill')
RegisterUnitEvent(26737, 4, 'mob26737_Die')
